#include "assign_stat.hpp"

#include "types.hpp"

AssignmentStatement::AssignmentStatement(std::string type, std::string name, Expression* value) : value(value) {
    this->type = type;
    this->name = name;
}

std::string AssignmentStatement::str() const {
    return type + ' ' + name + " = " + value->str();
}

std::string AssignmentStatement::to_code() const {
    return types[type] + ' ' + name + " = " + value->to_code() + ';' + '\n';
}
